<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://static.web.sdo.com/chuanshi/common/react.development.js"></script>
    <script src="http://static.web.sdo.com/chuanshi/common/react-dom.development.js"></script>
    <script src="http://static.web.sdo.com/chuanshi/common/babel.min.js"></script>
</head>
<body>
    <div class="container">
        <div id="app"></div>
    </div>
</body>
</html>
<script type="text/babel">
    class App extends React.Component {
        state = { num: 0 }
        constructor(props) {
            super(props);
            console.log("====constructor====");
        }
        componentWillMount() {
            console.log("====componentWillMount====");
        }
        componentDidMount() {
            console.log("====componentDidMount====");
        }
        render() {
            console.log("====render====");
            return (
                <div className="container">
                    <div className="mt-4 mb-4 alert alert-danger">
                        当前数组：{this.state.num}
                    </div>
                    <button onClick={this.death} className="btn btn-danger">卸载组件</button>
                </div>
            )
        }
    }
    ReactDOM.render(<App />, document.getElementById("app"))
</script>